home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
v cisle
/
sadanastroju
/
footiefox-2.1.2-fx.xpi
/
chrome
/
footiefox.jar
/
content
/
footiefox
/
about.js
< prev
next >
Wrap
Text File
|
2007-08-09
|
2KB
|
66 lines
function logoClicked(event) {
//left mouse button clicked
if (event.button == 0 ) {
window.opener.loadURI('http://www.footiefox.com');
//right mouse button button
} else if (event.button == 2) {
var gDBTPrefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
var prefNode = gDBTPrefService.getBranch("extensions.footiefox.");
if (prefNode.prefHasUserValue("tempdir")) {
try {
openDir(prefNode.getCharPref("tempdir"));
} catch (e) {
var output = "Your temp dir: " + prefNode.getCharPref("tempdir");
alert( output );
}
} else {
var output = "Could not set temp dir!";
alert( output );
}
}
}
function openDir(dirPath) {
var dir = getLocalFileInterface(dirPath);
try {
dir.reveal();
} catch (ex) {
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService)
.newFileURI(dir);
var protocolService = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
protocolService.loadUrl(uri);
}
}
function getLocalFileInterface(filePath) {
try {
var file = Components.interfaces.nsILocalFile;
var fileInterface = Components.classes["@mozilla.org/file/local;1"].createInstance(file);
fileInterface.initWithPath(filePath);
return fileInterface;
} catch (ex) {
return null;
}
}